<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path=request.getScheme()+"://"+request.getServerName()+":"+
	request.getServerPort()+request.getContextPath()+"/";
	pageContext.setAttribute("path", path);
%>


<!DOCTYPE html>
<html>
<head>
    <title>查看医生</title>
    <base href="<%=this.getServletContext().getContextPath() %>/doctor/">
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../static/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../static/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../static/css/style.css" />
    <script type="text/javascript" src="../static/js/jquery-3.4.1.js"></script>

    <script type="text/javascript" src="../static/js/bootstrap.js"></script>
    <script type="text/javascript" src="../static/js/ckform.js"></script>
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">

    </script>
</head>
<body>
<table class="table table-bordered table-hover definewidth m10" id = "table-detail">
    <tr>
        <td width="10%" class="tableleft">姓名</td>
        <td id = "name"> </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">证件号</td>
        <td id = "cardno"> </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">手机</td>
        <td id = "phone"> </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">性别</td>
        <td id = "sex">
        	 
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">年龄</td>
        <td id = "age"> </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">出生年月</td>
        <td id = "birthday"> </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">电子邮箱</td>
        <td id = "email"> </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">所属科室</td>
        <td id = "department">
        	
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">学历</td>
        <td id = "education">
        	
        </td>
    </tr>
	<tr>
        <td width="10%" class="tableleft">备注</td>
        <td id = "remark"> </td>
	</tr>
    <tr>
        <td colspan="2">
			<center>
				<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
			</center>
		</td>
    </tr>
</table>

    <script type="text/javascript">
	 $(function () {       
			$('#backid').click(function(){
				 //祖传方法
				 window.location.href = "${path}doctor/index.jsp";
			 });
	});
    
    
    
    
    $(function(){
		var url = location.search;
		var did = url.split("did=")[1];

		$.ajax({
			url:"${path}doctors/getDoctorInfo",
 			type:"post",
 			data:{"did":did},
 			dataType:"json",
 			success:function(message){
	
				
				$("#name").html(message.name);
				$("#cardno").html(message.cardno);
				$("#phone").html(message.phone);
				if(message.sex == 0){
					$("#sex").html("男");
				}else{
					$("#sex").html("女");
				}
				
				$("#age").html(message.age);
				$("#birthday").html(message.birthday);
				$("#email").html(message.email);
				$("#name").html(message.name);
				$("#department").html(message.department);
				$("#education").html(message.education);
				$("#remark").html(message.remark);
				
 			}

		});

	})
    </script>



</body>
</html>